(function() {
  var HttpHandler, ViewContentHandler, ViewDataHandler, homePageHandle, _;

  _ = require('underscore');

  ViewContentHandler = require('../helpers/view_content_handler');

  HttpHandler = require('../../../helpers/http_handler');

  ViewDataHandler = require('../models/view_data_handler');

  /**
   * [homePageHandle description]
   * @param  {[type]}   req  [description]
   * @param  {[type]}   res  [description]
   * @param  {Function} next [description]
   * @return {[type]}        [description]
  */


  homePageHandle = function(req, res, next) {
    return ViewDataHandler.home(function(err, data) {
      var renderData, view;
      if (err) {
        return res.render('error', 504);
      } else {
        view = 'vicanso/home';
        renderData = ViewContentHandler.home(req, view, '每天再往前一点！', 0, data);
        return HttpHandler.renderAndCache(req, res, view, renderData);
      }
    });
  };

  module.exports = homePageHandle;

}).call(this);
